import { listShowDiscuss,delShowDiscuss,updateShowDiscussReviewStatus} from '../services/discuss';

export default {
  /*namespace 是 model state 在全局 state 所用的 key，state 是默认数据*/
  namespace: 'discuss',

  state: {

  },

  effects: {
    /**
     * 展示电台秀评论
     * @param payload
     * @param callback
     * @param call
     * @param put
     */
    *listShowDiscuss({ payload,callback }, { call, put }) {
      const response = yield call(listShowDiscuss, payload);
      if (callback) callback(response);
    },
    /**
     * 删除电台秀平论
     * @param payload
     * @param callback
     * @param call
     * @param put
     */
    *delShowDiscuss({ payload,callback }, { call, put }) {
      const response = yield call(delShowDiscuss, payload);
      if (callback) callback(response);
    },
    *updateShowDiscussReviewStatus({ payload,callback }, { call, put }) {
      const response = yield call(updateShowDiscussReviewStatus, payload);
      if (callback) callback(response);
    },
  },
  /*reducer 是唯一可以更新 state 的地方，接收参数 state 和 action，返回新的 state，*/
  reducers: {

  },
};
